height = int(input())
breidd = int(input())
floturH = int(input())
floturB = int(input())

def leysa(a, b, GefA, GefB):
	fjoldi = (GefA//a)*(GefB//b)
	if (GefA//a)*(GefB//b) == (GefA*GefB)/(a*b):
		return (GefA*GefB)/(a*b)
	if GefA%a == 0:
		GefB -= GefB/b
		if GefB != b/2:
			return fjoldi+(GefB/b)
		if GefB == b/2:
			return fjoldi+(GefB//(2*b))

	if GefB%b == 0:
		GefA -= GefA/a
		if GefA != a/2:
			return fjoldi+(GefA//a)
		if GefA == a/2:
			return fjoldi+(GefA//(2*a))
	return 0

x = leysa(height, breidd, floturH, floturB)
y = leysa(breidd, height, floturH, floturB)

if x == 0:
	print(y)
if y == 0:
	print(x)
elif x < y:
	print(x)
else: print(y)

